<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改服务订单')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-serviceOrder-edit" th:object="${zsyhServiceOrder}">
            <input name="id" th:field="*{id}" type="hidden">
            <input name="orderState" id="orderState" th:field="*{orderState}" type="hidden">
            <div class="row">
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label">取消订单备注：</label>
                        <div class="col-xs-10">
                            <textarea name="cancelRemark" placeholder="请输入备注信息" class="form-control" rows="6"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <div style="width:100%;text-align:center">
        <button type="submit" style="margin-right: 100px;width: 100px;" class="btn btn-sm btn-primary"  onclick="submitHandler()"><i class="fa fa-check"></i>确定</button>
        <button type="button" style="width: 100px" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关闭</button>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "zsyh/serviceOrder";
        $("#form-serviceOrder-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $("#orderState").val("5");
                $.operate.save(prefix + "/edit", $('#form-serviceOrder-edit').serialize());
            }
        }

        $("input[name='orderDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        function closeItem() {
            $.modal.close();
        }

    </script>
</body>
</html>